// 折线图
export let optionLine = {
  baseOption: {
    // 线段颜色，一个值对应一条
    // color: ["#00f2f1", "#ed3f35", "#76DA91"],
    // 悬浮信息
    tooltip: {
      position: "right",
      // 通过坐标轴来触发
      trigger: "axis",
      axisPointer: {
        // 坐标轴指示器，坐标轴触发有效
        type: "line" // 默认为直线，可选为：'line' | 'shadow'
      },
      precision: "2",
      // {a}（系列名称），{b}（类目值），{c}（数值）, {d}（无）
      // formatter: '{b}月</br>{a}: {c}'
      // formatter: function (params) {
      //   return params[0].axisValue + '月</br>' + params[0].seriesName + ':' + params[0].value;
      // }
    },
     // 图表节点数值
     label: {
      show: true,
      // top left right bottom inside
      // position: "top",
      rotate: "0",
    },
    // 图表标题样式
    title: {
      show: true,
      text: "Line Title",
      link: "",
      target: "blank",
      textStyle: {
        color: 'rgba(255,255,255,0.8)',
        fontWeight: 'bold',
        fontFamily: 'Microsoft YaHei',
        fontSize: '100%'
      },
      subtext: "",
      sublink: "",
      subtarget: "blank",
      subtextStyle: {
        color: 'rgba(255,255,255,0.8)',
        fontWeight: 'bold',
        fontFamily: 'Microsoft YaHei',
        fontSize: '100%'
      },
      left: "center",
      top: "2%"
    },
    // 图例提示样式
    legend: {
      show: true,
      orient: "horizontal",
      top: "0",
      left: "left",
      // circle rect roundRect triangle diamond pin arrow none
      icon: "react",
      itemWidth: 10,
      itemHeight: 10,
      // 修饰图例文字的颜色
      textStyle: {
        color: "rgba(255,255,255,.5)",
        fontSize: "12"
      },
    },
    // 图表网格位置
    grid: {
      left: "15%",
      right: "10%",
      bottom: "4%",
      top: "10%",
      // backgroundColor: "transparent",
      containLabel: true,
    },
    // 横轴
    xAxis: {
      show: true,
      // 坐标轴类型
      type: "category",
      // x轴标签位置
      position: "bottom",
      // 坐标轴两边留白策略
      boundaryGap: false,
      data: [1, 2, 3, 4, 5, 6, 7],
      // 是否显示刻度
      axisTick: {
        alignWithLabel: true,
        show: true
      },
      // 修饰刻度标签
      axisLabel: {
        show: true,
        interval: 0,
        color: "rgba(255,255,255,.7)",
        fontSize: "12",
        // x轴标签旋转角度
        rotate: "0",
        verticalAlign: 'top',
      },
      // 坐标轴线
      axisLine: {
        show: true,
        lineStyle: {
          color: "rgba(255,255,255)",
          type: "solid"
        }
      },

    },
    yAxis: {
      show: true,
      type: "value",
      position: "left",
      // 坐标轴两边留白策略
      boundaryGap: false,
      // 是否显示刻度
      axisTick: {
        show: true
      },
      // 修饰刻度标签的颜色
      axisLabel: {
        show: true,
        color: "rgba(255,255,255,.7)",
        fontSize: "12",
      },
      // 修改y轴分割线的颜色
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,.1)"
        }
      },
      axisLine: {
        show: true,
        alignWithLabel: true,
        lineStyle: {
          color: "rgba(255,255,255)",
          type: "solid"
        }
      },
    },
    series: [{
        // tooltip名称
        name: "进口",
        type: "line",
        // 线上的点的形状 circle rect roundRect triangle diamond pin arrow none 
        symbol: 'emptyCircle',
        // 是否让线条圆滑显示
        smooth: true,
       
        data: [24, 40, 101, 134, 90, 230, 210]
      },

    ],
    dataZoom: [{
      show: true,
      start: 0,
      end: 100
    }],
  },
  extInfo: {
    x: '',
    y: '',
  },
};

// 柱状图
export let optionBar = {
  baseOption: {
    // color: ["#66B8F3", "#00f2f1", "#76DA91"],
    tooltip: {
      trigger: "axis",
      axisPointer: {
        // 坐标轴指示器，坐标轴触发有效
        type: "shadow" // 默认为直线，可选为：'line' | 'shadow'
      },
      precision: "2",
      // formatter: function (params) {
      //   let str = params[0].name + '</br>' + '途经总量：' + params[0].value + '</br>';
      //   if (params[0].data.newaddly !== "") {
      //     str += '新增：' + params[0].data.newaddly;
      //   }
      //   if (params[0].data.diagnoisis !== "") {
      //     str += ' 确诊：' + params[0].data.diagnoisis + '</br>';
      //   }
      //   if (params[0].data.death !== "") {
      //     str += '死亡：' + params[0].data.death;
      //   }
      //   if (params[0].data.mortality !== "") {
      //     str += ' 治愈：' + params[0].data.mortality;
      //   }
      //   return str;
      // }
    },
     label: {
        show: true,
        // top left right bottom inside
        position: "top",
        rotate: "0",
      },
    title: {
      show: true,
      text: "Bar Title",
      link: "",
      target: "blank",
      textStyle: {
        color: 'rgba(255,255,255,0.8)',
        fontWeight: 'bold',
        fontFamily: 'Microsoft YaHei',
        fontSize: '100%',

      },
      subtext: "",
      sublink: "",
      subtarget: "blank",
      subtextStyle: {
        color: 'rgba(255,255,255,0.8)',
        fontWeight: 'bold',
        fontFamily: 'Microsoft YaHei',
        fontSize: '100%'
      },
      top: "2%",
      left: 'center',
    },

    legend: {
      show: true,
      orient: "vertical",
      top: "0",
      left: "left",
      //circle rect roundRect triangle diamond pin arrow none
      icon: "react",
      itemWidth: 10,
      itemHeight: 10,
      textStyle: {
        color: "rgba(255,255,255,.5)",
        fontSize: "12"
      }
    },
    grid: {
      top: "15%",
      left: "10%",
      right: "10%",
      bottom: "4%",
      // backgroundColor: "transparent",
      containLabel: true
    },
    xAxis: {
      show: true,
      type: "category",
      // x轴位置
      position: "bottom",
      //更换数据
      data: [1, 2, 3, 4, 5, 6, 7],
      // 坐标轴两边留白策略
      boundaryGap: false,
      // 是否显示刻度
      axisTick: {
        alignWithLabel: true,
        show: false
      },
      axisLabel: {
        show: true,
        interval: 0,
        color: "rgba(255,255,255,0.8)",
        fontSize: "12",
        rotate: '45',
        verticalAlign: 'top'
      },
      axisLine: {
        show: true,
        lineStyle: {
          color: "rgba(255,255,255)",
          type: "solid"
        }
      }
    },
    yAxis: {
      show: true,
      type: "value",
      position: "left",
      // 坐标轴两边留白策略
      boundaryGap: false,
      // 是否显示刻度
      axisTick: {
        show: true
      },
      axisLabel: {
        show: true,
        color: "rgba(255,255,255,.8)",
        fontSize: "12",
      },
      splitLine: {
        lineStyle: {
          color: "rgba(255,255,255,.1)"
        }
      },
      axisLine: {
        show: true,
        alignWithLabel: true,
        lineStyle: {
          color: "rgba(255,255,255)",
          type: "solid"
        }
      },

    },
    series: [{
      name: "途径总量",
      type: "bar",
      // 勾
      barWidth: "35%",
     
      //柱体描边
      itemStyle: {
        // 柱条颜色
        color: "#66B8F3",
        borderColor: 'rgba(255,255,255)',
        // solid dashed dotted
        borderType: 'solid'
      },
      //获取数据
      data: [200, 300, 300, 900, 1500, 1200, 600],
    }],
    dataZoom: [{
      show: true,
      start: 0,
      end: 100
    }],
  },
  extInfo: {
    x: '',
    y: '',
  },
};

// 饼状图
export let optionPie = {
  baseOption: {
    // color: ["#63B3EF", "#76DA91", "#00f2f1"],
    tooltip: {
      position: 'right',
      trigger: "item",
      precision: "2",
      //{a}（系列名称），{b}（数据项名称），{c}（数值）, {d}（百分比）
      // formatter: '{b}: {c}<br/>{d}%',
    },
    title: {
      show: true,
      text: "Pie Title",
      link: "",
      target: "blank",
      textStyle: {
        color: 'rgba(255,255,255,0.8)',
        fontWeight: 'bold',
        fontFamily: 'Microsoft YaHei',
        fontSize: '100%',

      },
      subtext: "",
      sublink: "",
      subtarget: "blank",
      subtextStyle: {
        color: 'rgba(255,255,255,0.8)',
        fontWeight: 'bold',
        fontFamily: 'Microsoft YaHei',
        fontSize: '100%'
      },
      top: "2%",
      left: 'center',
    },
    legend: {
      show: true,
      // vertical horizontal
      orient: 'vertical',
      top: "0",
      left: "left",
      // circle rect roundRect triangle diamond pin arrow none
      icon: "react",
      itemWidth: 10,
      itemHeight: 10,
      textStyle: {
        color: "rgba(255,255,255,.5)",
        fontSize: "12"
      },
    },
    series: [{
      type: 'pie',
      //设置圆饼是不是空心
      radius: ['80%', "56%"],
      center: ['50%', '55%'],
      label: {
        show: true,
        position: 'outer',
        formatter(v) {
          let text = v.name.split('')
          let s = ''
          for (let i = 0; i < text.length; i++) {
            s += text[i] + (i % 2 != 0 ? '\n' : '')
          }
          return s
        }
      },
      labelLine: {
        show: false
      },
      //修改数据
      data: [{
        name: '一般风险国家',
        value: 214,
      }, {
        name: '中高风险国家',
        value: 10,
      }]
    }, ]
  }
};

// 仪表盘
export let optionGauge = {
  baseOption: {
    title: {
      show: true,
      text: "Gauge Title",
      link: "",
      target: "blank",
      textStyle: {
        color: 'rgba(255,255,255,0.8)',
        fontWeight: 'bold',
        fontFamily: 'Microsoft YaHei',
        fontSize: '100%',

      },
      subtext: "",
      sublink: "",
      subtarget: "blank",
      subtextStyle: {
        color: 'rgba(255,255,255,0.8)',
        fontWeight: 'bold',
        fontFamily: 'Microsoft YaHei',
        fontSize: '100%'
      },
      top: "2%",
      left: 'center',
    },
    tooltip: {
      formatter: '{b} : {c}'
    },
    series: [{
        // name: 'rrr',
        type: 'gauge',
        center: ['50%', '60%'], // 默认全局居中
        // 勾
        radius: '100%',
        min: 0,
        max: 200 * 2,
        // 结束角度
        endAngle: -45,
        axisLine: { // 坐标轴线
          show: true,
          lineStyle: { // 属性lineStyle控制线条样式
            color: [
              [0.29, 'lime'],
              [0.86, '#1e90ff'],
              [1, '#ff4500']
            ],
            width: 1,
            shadowColor: '#fff', //默认透明
            shadowBlur: 10
          }
        },
        axisLabel: { // 坐标轴小标记
          show: true,
          color: '#fff',
          shadowColor: '#fff', //默认透明
          shadowBlur: 10
        },
        axisTick: { // 坐标轴刻度(短)
          show: true,
          length: 4, // 属性length控制线长
          lineStyle: { // 属性lineStyle控制线条样式
            color: 'auto',
            shadowColor: '#fff', //默认透明
            shadowBlur: 10
          }
        },
        splitLine: { // 分隔线(长)
          show: true,
          length: 6, // 属性length控制线长
          lineStyle: { // 属性lineStyle（详见lineStyle）控制线条样式
            width: 3,
            color: '#fff',
            shadowColor: '#fff', //默认透明
            shadowBlur: 10
          }
        },
        // 指针
        pointer: {
          width: 5,
          shadowColor: '#fff', //默认透明
          shadowBlur: 5
        },
        detail: {
          backgroundColor: 'rgba(30,144,255,0.8)',
          borderWidth: 1,
          borderColor: '#fff',
          shadowColor: '#fff', //默认透明
          shadowBlur: 5,
          fontSize: "100%",
          textStyle: { // 其余属性默认使用全局文本样式，详见TEXTSTYLE
            fontWeight: 'bolder',
            color: '#fff',
          }
        },
        data: [{
          name: '',
          value: 200,
          title: {
            show: false,
            // width: "20",
            // overflow: "truncate",
            // offsetCenter: ['0', '80%'],
          },
          detail: {
            show: true,
            offsetCenter: [0, '50%'], // x, y，单位px
          }
        }]
      }

    ]
  },
}

// 表格
export let optionTable = {
  baseOption: {
    // 图表标题样式
    title: {
      show: true,
      text: "Table Title",
    },
  },
  extInfo: {},
};

// 统计表Sum表格
export let optionSum = {
  baseOption: {
    // 图表标题样式
    title: {
      show: true,
      text: "Table Title",
    },
    item1: {
      name: '',
      title: '',
      desc: '描述1',
    },
    item2: {
      name: '',
      title: '',
      desc: '描述2',
    },
    item3: {
      name: '',
      title: '',
      desc: '描述3',
    },
  },
  extInfo: {},
};

// 滚动表格
export let optionScrollTable = {
  baseOption: {
    // 图表标题样式
    title: {
      show: true,
      text: "Scroll Table Title",
    },
  },
  extInfo: {},
};